<ui-panel>
    <form name="form" class="form-horizontal" ng-submit="form.$valid && vm.next()">
        <div class="form-group" ng-class="{'has-error':(form.name.$touched || form.$submitted ) &&
        (form.name.$error.required)}">
            <label for="name" class="col-sm-2 control-label">租户名称</label>
            <div class="col-sm-5">
                <input type="text" maxlength="50" id="name" name="name" ng-model="vm.fData.baseInfo.name" class="form-control" placeholder="请输入租户名称" required/>
                <!--<div class="text-danger" ng-show="(form.name.$touched || form.$submitted ) &&
                (form.name.$error.required || form.name.$error.pattern)">
                    请输入有效租户名称 ( 允许数字、英文字母与下划线 )</div>-->
            </div>
            <!--<div class="col-sm-5 text-info">
                ?不少于2个字符
            </div>-->
        </div>
        <div class="form-group" ng-class="{'has-error':(form.code.$touched || form.$submitted ) &&
        (form.code.$error.required || form.code.$error.pattern)||vm.hasCode}">
            <label for="code" class="col-sm-2 control-label">租户编码</label>
            <div class="col-sm-5">
                <div class="row">
                    <div class="col-sm-8">
 <input type="text" maxlength="50" id="code" name="code" ng-model="vm.fData.baseInfo.code" class="form-control" placeholder="请输入租户编码" ng-pattern="/^[A-Za-z\d-]+$/" required ng-blur="form.code.$valid&&vm.checkHasCode()" ng-focus="vm.checkHide()" ng-disabled="vm.notEditCode"/>
                
                <div class="text-danger" ng-show="form.code.$touched && vm.hasCode">
                    此租户编码已存在。</div>
                    </div>
                    <div class="col-sm-4"><div ng-show="vm.loading_code" class="control-label" style="margin-left:-20px;"><div class="loading-sm"></div></div></div>
                </div>
               
            </div>
            <div class="col-sm-5 text-info">
                ?允许数字、英文字母与横线
            </div>
        </div>
        <div class="form-group">
            <label for="cpu" class="col-sm-2 control-label">CPU</label>
            <div class="col-sm-5">
                <div class="row">
                    <div class="col-sm-5">
                        <div class="input-group"  ng-class="{'has-error':(form.cpu.$touched || form.$submitted ) &&
        (form.cpu.$error.required || form.cpu.$error.pattern)}">
                            <input type="text" maxlength="100" id="cpu" name="cpu" ng-model="vm.fData.baseInfo.cpu" class="form-control" placeholder="请输入cpu核数" ng-pattern="/^\d+$/" required/>
                            <div class="input-group-addon">核</div>
                        </div>
                    </div>
                    <div class="col-sm-7">
                        <div class="row">
                            <label for="ram" class="col-sm-4 control-label">内存</label>
                        <div class="col-sm-8">
                            <div class="input-group"  ng-class="{'has-error':(form.ram.$touched || form.$submitted ) &&
        (form.ram.$error.required || form.ram.$error.pattern)}">
                                 <input type="text" maxlength="100" id="ram" name="ram" ng-model="vm.fData.baseInfo.ram" class="form-control" placeholder="请输入ram配额" ng-pattern="/^\d+$/" required/>
                                <div class="input-group-addon">MB</div>
                            </div>
                        </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>

        <!--<div class="form-group" ng-class="{'has-error':(form.applied_count.$touched || form.$submitted ) &&
        (form.applied_count.$error.required || form.applied_count.$error.pattern)}">
            <label for="applied_count" class="col-sm-2 control-label">最大应用数</label>
            <div class="col-sm-5">
                <input type="text" id="applied_count" name="applied_count" ng-model="vm.fData.baseInfo.applied_count" class="form-control" placeholder="请输入最大应用数" ng-pattern="/^\d+$/" required/>
                <div class="text-danger" ng-show="(form.applied_count.$touched || form.$submitted ) &&
                (form.applied_count.$error.required || form.applied_count.$error.pattern)">
                    ( 只允许数字 )</div>
            </div>
        </div>-->
        <div class="form-group" ng-class="{'has-error':(form.living_count.$touched || form.$submitted ) &&
        (form.living_count.$error.required || form.living_count.$error.pattern)}">
            <label for="living_count" class="col-sm-2 control-label">最大实例数</label>
            <div class="col-sm-5">
                <input type="text" id="living_count" name="living_count" ng-model="vm.fData.baseInfo.living_count" class="form-control" placeholder="请输入最大实例数" ng-pattern="/^\d+$/" required/>
                <div class="text-danger" ng-show="(form.living_count.$touched || form.$submitted ) &&
                (form.living_count.$error.required || form.living_count.$error.pattern)">
                    ( 只允许数字 )</div>
            </div>
        </div>
        <div class="panel-form-footer">
            <a ui-sref="k8s-lessee({kDbCode:vm.kDbCode})" class="btn btn-default btn-sm">取消</a>
            <button type="submit" class="btn btn-primary btn-sm pull-right"><i ng-show="vm.nextLoading" class="fa fa-cog fa-lg fa-spin margin-right-5"/>下一步</button>
        </div>
    </form>
</ui-panel>